(define-module (sudoku square)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-9)
  #:export (square
            make-square square? square-value
            square-candidates))

(define-record-type <square>
  (make-square value candidates)
  square?
  (value square-value)
  (candidates square-candidates))

(define-public (make-square dimension)
  (make-square #f (iota dimension 1)))

(define-public (set-square-value square v)
  (make-square v (square-candidates square)))

(define-public (set-square-candidates square candidates)
  (make-square (square-value square) candidates))
